package xyz.erupt.flow.controller;

import lombok.var;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.erupt.core.constant.EruptRestPath;
import xyz.erupt.core.view.EruptApiModel;
import xyz.erupt.flow.conf.FlowConfig;
import xyz.erupt.flow.constant.FlowConstant;

import javax.annotation.Resource;

/**
 * @author PP
 * @version 1.0
 * @project erupt-flow
 * @description 服务端信息
 * @date 2024/10/15 15:28:52
 */
@RestController
@RequestMapping(EruptRestPath.ERUPT_API + "/" + FlowConstant.SERVER_NAME)
public class EruptFlowPropController {
    @Resource
    FlowConfig flowConfig;

    @GetMapping("getHost")
    public EruptApiModel getHost() {
        var host = flowConfig.getServerUrl();
        return EruptApiModel.successApi(host);
    }
}
